package top.frsf.factory;

import top.frsf.constants.ImageConstant;
import top.frsf.enums.PlantTypeEnum;
import top.frsf.object.plant.Pea;
import top.frsf.object.plant.PlantObject;
import top.frsf.object.plant.RepeaterPea;
import top.frsf.object.plant.SnowPea;

/**
 * 植物工厂
 *
 * @author He Kuntao
 * @since 2025/8/4 11:45
 */
public class PlantFactory {

    /**
     * 创建植物
     *
     * @param plantType 植物类型
     * @param x         坐标
     * @param y         坐标
     * @return 植物对象
     */
    public static PlantObject createPlant(PlantTypeEnum plantType, int x, int y) {
        switch (plantType) {
            case PEA:
                return new Pea(x, y);
            case SNOW_PEA:
                return new SnowPea(x, y);
            case REPEATER_PEA:
                return new RepeaterPea(x, y);
            default:
                return null;
        }
    }
}
